<template>
  <el-tabs type="border-card" style="min-height: 80vh" v-model="active">
    <el-tab-pane label="还款登记" name="first">
      <repay-register :query-id="queryId" @success="handleSuccess" ref="repayEdit"></repay-register>
    </el-tab-pane>
    <el-tab-pane label="还款计划" name="plan">
      <after-repay-plan
        :query-id="queryId"
        ref="repayPlan"
        @success="handlerGetter"
      ></after-repay-plan>
    </el-tab-pane>
  </el-tabs>
</template>

<script>
import AfterRepayPlan from '@/credit/views/city/self/after/repay/AfterRepayPlan'
import RepayRegister from '@/credit/views/city/self/after/repay/RepayRegister'
export default {
  components: {
    AfterRepayPlan,
    RepayRegister,
  },
  props: {
    queryId: String,
  },
  data() {
    return {
      active: 'first',
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    reSet() {
      this.active = 'first'
    },
    handlerGetter() {
      this.$nextTick(() => {
        this.$refs.repayEdit.getPlan()
      })
    },
    handleSuccess() {
      this.$emit('success', true)
      this.$nextTick(() => {
        this.$refs.repayPlan.getData()
      })
    },
  },
}
</script>

<style lang="scss" scoped></style>
